summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2018-11-03Conformance tests work under Bazel.Josh Haberman
2018-09-18Fix json encoding for wrappers, ListValue, Struct and Value. (#126)Paul Yang
* Fix json encoding for wrappers, ListValue, Struct and Value. * Add well_known_type field in upb_msgdef to specify type of well known messages. * Remove comma at end of enum definition. * Group number wrappers * Fix comments * Refactoring to use is_wellknown_{msg/field}
2018-09-06Disabled another Lua test for the time being.Josh Haberman
2018-09-06Removed default instance and oneof array from tables.Josh Haberman
2018-09-06Removed unused variable.Joshua Haberman
2018-09-06Changed C API to use inline functions and computed offsets.Joshua Haberman
2018-09-03Changed C API to only define structs, a table, and a few minimal inline ↵Joshua Haberman
functions.
2018-09-02More work on CMake build, and updated conformance for proto3.Joshua Haberman
2018-08-27Got CMake build working on macOS, and updated CMake build.Joshua Haberman
2018-08-12Enforced that upb_msg lives in an Arena only, and other simplifying.Joshua Haberman
upb_msg was trying to be general enough that it could either live in an arena or be allocated with malloc()/free(). This was too much complexity for too little benefit. We should commit to just saying that upb_msg is arena-only. I also ripped out the code to glue upb_msg to the existing handlers-based encoder/decoder. upb_msg has its own, small, simple encoder/decoder. I'm trying to whittle down upb_msg to a small and simple core. I updated the Lua extension for these changes. Lua needs some more work to properly create arenas per message. For now I just created a single global arena.
2018-06-27Enable ignore unknown field in json parsingBo Yang
2018-03-07Added google/protobuf/descriptor.upb.* to core.Josh Haberman
This is in preparation for making upb_def capable of parsing binary descriptors directly. We leave upb/descriptor/descriptor.upbdefs.* in place for now, because upb/descriptor/reader.* still depends on it. Also removed a bit of cruft from the codegen.
2017-09-21Modify selector base in tests/json/test.upbdefs.ccBo Yang
2017-07-19Address review comments and fix compile warnings.Joshua Haberman
2017-07-18Responded to PR comments.Joshua Haberman
2017-07-18Fixes for oneof conformance tests.Joshua Haberman
2017-07-18Fixed varint length when buffer is reallocated.Joshua Haberman
2017-07-17New encode/decode: most (171 / 192) conformance tests pass.Joshua Haberman
2017-07-08A good start on upb_encode and upb_decode.Josh Haberman
2017-07-04First version of a real C codegen for upb.Joshua Haberman
Also includes an implementation of the conformance tests to display what the API usage will be like. There is still a lot to do, and things that are broken (oneofs, repeated fields, etc), but it's a good start.
2017-07-02Start migrating upb_msglayout to be suitable for generated code.Joshua Haberman
This involves: - remove upb_msglayout -> upb_msgfactory dependency. - remove upb_msglayout -> upb_msgdef dependency (in progress). - make upb_msglayout use a representation that can be statically initialized by generated code. The goal here is that upb_msglayout becomes a kind of "descriptor lite": it contains enough data to parser and serialize protobufs and manipulate a upb_msg in memory, while being far smaller and simpler than a full descriptor. It also does not include field names, which can be a benefit for applications that do not want to leak field names. Generated code can then create a upb_msglayout, and do most things without ever needing to construct full descriptors/defs if they don't want to.
2017-03-14Deleted some dead code related to varint decoding.Josh Haberman
2017-01-23A couple more fixes.Josh Haberman
2017-01-23Removed all code for adding extensions to upb_symtab.Josh Haberman
This means extensions can't be used until we implement the replacement APIs for accessing extensions from a symtab.
2017-01-21Ripped out complicated and unused code for replacing defs in a symtab.Josh Haberman
Also hid the dup() functions. We can't quite delete them yet because our current approach for extensions depends on duplicating defs.
2017-01-21Make upb::SymbolTable no longer reference-counted.Josh Haberman
This transitions it from shared ownership to unique ownership.
2016-12-12Basic serialization for upb_msg and Lua.Josh Haberman
Doesn't yet include strings, submessages, maps, or repeated fields.
2016-12-07Merge pull request #74 from haberman/msgJoshua Haberman
Added upb_msg and Lua bindings for using it.
2016-12-06Changes for PR comments.Josh Haberman
2016-11-29Fixed some bugs surfaced by Travis.Josh Haberman
2016-11-29New upb_msg code and Lua bindings around it.Josh Haberman
There are still some things that are unfinished, but we are at parity with what Lua had before.
2016-11-13Fix glibc coupling in testHATATANI Shinta
2016-09-09Some refcounting fixes.Josh Haberman
Clearly this stuff is too complex overall. The plan is to move away from this and more towards pools, like proto2 uses.
2016-09-09Merge pull request #69 from haberman/oneofdescJoshua Haberman
Added support for loading oneofs from descriptors.
2016-09-08Added support for loading oneofs from descriptors.Josh Haberman
2016-08-16WIP.Josh Haberman
2016-05-12Added UPB_ASSERT() that helps avoid unused var warnings.Joshua Haberman
* Added UPB_ASSERT() that helps avoid unused var warnings. * Addressed PR comments. * Fixed assert in the JIT.
2016-04-21Put oneofs in the same table as fields. (#60)Joshua Haberman
* Put oneofs in the same table as fields. Oneofs and fields are not allowed to have names that conflict, so we might as well put them all in the same table. This also allows an efficient operation that looks for both fields and oneofs in a single lookup. Added support for OneofDef to Lua to allow testing of this. * Addressed PR comments.
2016-04-19Changed schema for JSON test to be defined in a .proto file. (#54)Joshua Haberman
* Changed schema for JSON test to be defined in a .proto file. Before we had lots of code to build these schemas manually, but this was verbose and made it difficult to add to the schema easily. Now we can just write a .proto file and adding fields is easy. To avoid making the tests depend on upbc (and thus Lua) we check in the generated schema. * Made protobuf-compiler a dependency of "make genfiles." * For genfiles download recent protoc that can handle proto3. * Only use new protoc for genfiles.
2016-04-19Split upb::Arena/upb::Allocator from upb::Environment. (#58)Joshua Haberman
* Split upb::Arena/upb::Allocator from upb::Environment. This will allow arenas and allocators to be used independently of environments, which will be important for an upcoming change (a message representation). Overall this design feels cleaner that the previous Environment/SeededAllocator design. As part of this change, moved all allocations in upb to use a global allocator instead of hard-coding malloc/free. This will allow injecting OOM faults for more robust testing. One place that doesn't use the global allocator is the tracked ref code. Instead of its previous approach of CHECK_OOM() after every malloc() or table insert, it simply uses an allocator that does this automatically. I moved Allocator/Arena/Environment into upb.h. This seems principled since these are the only types in upb whose size is directly exposed to users, since they form the basis of memory allocation strategy. * Cleaned up some header includes and fixed more malloc -> upb_gmalloc(). * Changes from PR review. * Don't use UINTPTR_MAX or UINT64_MAX. * Punt on adding line/file for now. * We actually can't store (uint64_t)-1, update comment and test.
2016-04-14JSON parser: always accept both name variants, flag controls which we generate.Joshua Haberman
* JSON parser: always accept both name variants, flag controls which we generate. My previous commit was based on wrong information about the proto3 JSON spec. It turns out we need to accept both field name formats all the time, and a runtime flag should control which we generate. * Documented the preserve_proto_fieldnames option. * Fix bugs in PR.
2016-04-06Refactored upb_def_freeze() a bit per PR comments.Josh Haberman
2016-04-06Changes for PR comments.Josh Haberman
2016-04-05Added upb::FileDef, which represents the file defs are declared in.Josh Haberman
It is entirely optional: MessageDef/EnumDef can still exist on their own. But this can represent a def's file when it is desirable to do so (eg. for code generators). This approach will require that we change the way we handle extensions. But I think it will be a good change overall. Specifically, we previously handled extensions by duplicating the extended message and then adding the extension as a regular field to the duplicated message. This required also duplicating any messages that could reach the extended message. In the new world we will need a way of declaring and looking up extensions separately from the message being extended. This change also involves some notable changes to the generated code: - files are now called foo.upbdefs.h instead of foo.upb.h. This reflects the fact that we might possibly generate several different output files for a .proto file, and this one is just for defs. - we no longer generate selectors in the .h file. - the upbdefs.c no longer vends a SymbolTable. Now it vends the individual messages (and possibly a FileDef later). I think this will compose better once we can generate files where one generated files imports another. We also make the descriptor reader vend a list of FileDefs now. This is the best conceptual match for parsing a FileDescriptorSet.
2016-02-17Changed JSON parser/printer to correctly camelCase names.Josh Haberman
2015-08-19Refer to a shared definition for max buffered bytes.Josh Haberman
2015-08-14Added lots of decoder tests and fixed lots of bugs.Josh Haberman
2015-08-13Fix from google3: memory leak caught by heapcheck.Josh Haberman
2015-08-11More decoder fixes, and slightly changed parse call semantics.Josh Haberman
Prior to this change, if an error was returned, it would be guaranteed to always return a short byte count. Now the two concepts are a bit more orthogonal. There are cases where the entire input is consumed even though an error was encountered.
2015-07-31Decoder fix: skipped data at end of submessage.Josh Haberman
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback